package com.filex.ads.common;

public enum AdError implements ErrorCode {

    NO_FILL("Ad no fill"),
    BAD_REQUEST("Bad Request"),
    UNSPECIFIED("Unspecified error"),
    CONNECTION_ERROR("Network is not available"),
    INTERNAL_ERROR("Internal error");

    final String message;

    AdError(String msg) {
        message = msg;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return this.message;
    }

    @Override
    public int getIntCode() {
        switch (this) {
            case NO_FILL:
                return ER_NO_FILL;
            case BAD_REQUEST:
                return ER_BAD_REQUEST;
            case CONNECTION_ERROR:
                return ER_NETWORK_CONN;
            case INTERNAL_ERROR:
                return ER_INTERNAL;
            case UNSPECIFIED:
                return ER_UNSPECIFIED;
        }
        return ER_UNSPECIFIED;
    }
}
